<script lang="ts" setup>
import { onMounted } from 'vue';
const emit = defineEmits(['jump']);
const props = defineProps<{
  src: string;
  obj: any;
  validate: string
}>();
onMounted(() => {
  // props.obj
});
</script>

<template>
  <view class="gos max-w-4xl mx-auto p-2 bg-white rounded-sm shadow-md" @click="emit('jump')">
    <view class="flex gap-2 items-start w-full box-border">
      <!-- Product Image Placeholder -->
      <image class="w-100 h-100 bg-gray-300 rounded-lg flex-shrink-0" mode="aspectFill" :src="props.src"></image>

      <!-- Product Information -->
      <view class="flex-1 space-y-1 overflow-hidden">
        <!-- Product Title and Codes -->
        <view class="space-y-2">
          <view class="flex items-center gap-2 text-gray-700">
            <!-- <text class="truncate">{{ props.obj.type_name }}</text> -->
            <text class="truncate text-[24rpx]">服务项目编号：WG03043</text>
          </view>
        </view>

        <view class="flex items-center justify-between gap-2 text-gray-700">
          <text class="truncate flex-1 text-[28rpx] font-medium">{{ props.obj.type_name || props.obj.typeName }}</text>
          <!-- <view class="truncate">预收价格：<text class="line-through">¥292.00</text> <text>¥{{ props.obj.price }}</text>
          </view> -->
        </view>

        <view class="flex items-center justify-between gap-2 text-gray-700">
          <text class="truncate text-[26rpx]">预收价格：¥{{ props.validate == '0' ? props.obj.price : props.obj.pricenew }}</text>
        </view>


      </view>
    </view>
  </view>
</template>
